package com.thinkingcoder.common.http;

import java.util.concurrent.TimeUnit;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class HttpProperties {
    /**
     * 连接池
     */
    // 最大连接数
    private int maxIdleConnections = 16_000;
    // 连接保活时间
    private int keepAliveDuration = 120_000;

    /**
     * 超时时间
     */
    // 读超时时间
    private int readTimeout = 60_000;
    // 写超时时间
    private int writeTimeout = 60_000;
    // 连接超时时间
    private int connectTimeout = 60_000;

    /**
     * 重试
     */
    // 连接失败时重试
    private boolean retryOnConnectionFailure = true;

    private TimeUnit timeUnit = TimeUnit.MILLISECONDS;
}
